#pragma once

#ifndef ROCK_H
#define ROCK_H

#include "Entity.h"
#include "EntityManager.h"
#include "Particle.h"
#include "Gravity.h"
#include "Drag.h"
#include "Level.h"
#include "ForceRegistry.h"

class Rock : public Entity
{
private:
	Particle particle;
	Gravity gravity;
	Drag drag;
	Level* level;
	D3DXVECTOR3 worldPosition;
public:
	Rock(D3DXVECTOR3 position, D3DXVECTOR3 velocity, IDirect3DTexture9* texture, Level* level)
		: Entity(position, texture, "Rock"),
		particle(position, velocity, 100.0f),
		gravity(D3DXVECTOR3(0, 500.0f, 0)),
		drag(0.1f, 0.5f),
		level(level)
	{
		ForceRegistry::add(&particle, &gravity);
		ForceRegistry::add(&particle, &drag);
		this->worldPosition = position;
	}
	~Rock() { }
	void update(float frameTime);
	void draw(ID3DXSprite* sprite);
};

#endif